<extend name="Base/base" />
<block name='head'>
    <!--<link rel="stylesheet" type="text/css" href="/Public/Admin/css/index.css"/>-->
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <script src="/Public/static/layer/layer.js"></script>
    <style>
        .textarea{height:50px;width:90%}
        .checkCont p{float:left;}
        .checkCont a{margin-left:10px;display: inline-block;}
        .fujian{margin:0;}
        .c-red{color:red}
        .pointer{cursor: pointer}
        .box .icon-date{
            background:url('/Public/Admin/images/date.png') no-repeat right center;
            width: 25px;
            height: 25px;
            position: absolute;
            top: 6px;
            right: 11px;
            cursor:pointer;
        }
    </style>
</block>
<block name="content"> 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-normal newsAdd_btn" href="{:U('diary')}">返回</a>
                    </div>
                </blockquote>
                <!-- 表单项 -->
                <form class="layui-form" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:70px;">标题</label>
                        <div class="layui-input-block box" style="position: relative;width:200px;margin-left:70px;">
                            <i class='icon-date datepickerInput' id="diary_date"></i>
                            <input name="subject" id="subject" class="layui-input" <if condition="$dia_id eq ''">value='{$subject}'<else />value='{$diary.subject}'</if> style="display:inline;">
                            <!--<input type="text" class="layui-input datepickerInput" id="diary_date" <if condition="$dia_id eq ''">value='{:date("Y-m-d")}'<else />value='{$diary.dia_date}'</if> style="width:10%;display:inline;">-->
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label" style="width:70px;">内容</label>
                        <div class="layui-input-block" style="margin-left:70px;">
                            <textarea name="content" id="content">{$diary.content}</textarea>
                        </div>
                    </div>
<!--                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">附件与权限</label>
                        <div class="layui-input-block">
                            <a href="#" id="upload" style='margin-top: 7px;display: inline-block;font-size: 12px;'><span class="fj">上传附件</span><span class="icon_add">&#xe638;</span></a>
                            <div class="filename-cont">
                                <span><if condition="$diary.uploads neq ''">{$diary.uploads}<img src="/Public/Index/img/close.png" style="width:15px" class="pointer delfile" data-fileurl="{$diary.uploads_url}"/></if></span>
                            </div>
                            <input type="file" id="inputImage" name='imgfile' style="display:none">
                            <input type="hidden" id="filename" name="uploads" value="{$diary.uploads}">
                            <input type="hidden" id="fileurl" name="uploads_url" value="{$diary.uploads_url}">
                            <input type="hidden" name="url" value="{:U('Base/delFile')}">
                        </div>
                    </div>   -->
                    <div class="layui-form-item">
                        <div class="layui-input-block" style="margin-left:70px;">
                            <a class="layui-btn btn-submit ajax-post" data-url="{:U('saveDiary')}" data-form="">提交</a>
                            <button type="reset" class="layui-btn layui-btn-primary reset">重置</button>
                        </div>
                    </div>
                    <input type='hidden' name='dia_id' value='{$diary.dia_id}'>
                </form>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <!--编辑器-->
    <link rel="stylesheet" href="__PUBLIC__/static/ueditor/themes/default/css/ueditor.css"/>
    <script type="text/javascript" src="__PUBLIC__/static/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/static/ueditor/ueditor.all.min.js"></script>
    
    <script type="text/javascript">
        $(dateTime(3));
        $('.reset').click(function(){
            ue.setContent('');
        })
        var width = $('.editorArea').width();
        var ue = UE.getEditor('content', {
            initialFrameWidth: width,
            initialFrameHeight: 200,
            toolbars: [[
                    "source", "undo", "redo", "insertunorderedlist", "insertorderedlist", "unlink", "link",
                    "searchreplace", "preview", "pagebreak", "simpleupload", "emotion",
                    "date", "time", "horizontal", "pasteplain",
                    "bold", "italic", "underline", "strikethrough", "forecolor", "backcolor",
                    "superscript", "subscript", "justifyleft", "justifycenter", "justifyright", "justifyjustify",
                    "formatmatch", "removeformat", "lineheight", "fontfamily", "fontsize",
                ]],
            elementPathEnabled : false,
             wordCount:false 
        });
        
        $(function(){
            $('#edui1_bottombar').remove();
        })

    </script>    
    
</block>
